package com.woniuxy.microfixeddepositserver.controller;

import com.alibaba.fastjson.JSONObject;
import com.woniuxy.bean.ResultBean;
import com.woniuxy.microfixeddepositserver.bean.PurchaseBean;
import com.woniuxy.microfixeddepositserver.service.IPurchaseRequestService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author: masterhai
 * @date: 2021/4/10:10:33
 * @description:
 */
@RefreshScope
@RestController
@Slf4j
@RequestMapping(value = "/purchase", produces = {"application/json;charset=utf-8"})
public class PurchaseRequestController {
    @Resource
    private IPurchaseRequestService purchaseRequestService;

    @GetMapping("purchaseType")
    public ResultBean selectAllPurchaseType () {
        List<PurchaseBean> purchaseBeans = purchaseRequestService.selectAllPurchaseType();
        return ResultBean.builder().code(200).msg("查询风险等级数据成功").data(purchaseBeans).build();
    }

}
